package com.kly.user.enums;

import com.fqgj.common.utils.StringUtils;

public enum AppCode {
    chat01("chat01", "测试版本号-0.1"),

    isnull("", "不存在的版本号"),

    ;
    private final String AppCode;

    private final String description;


    AppCode(String appCode, String description) {
        AppCode = appCode;
        this.description = description;
    }

    public String getAppCode() {
        return AppCode;
    }

    public String getDescription() {
        return description;
    }

    public static AppCode fromType(String type) {
        if (StringUtils.isEmpty(type)) {
            return isnull;
        }
        for (AppCode appCode : values()) {
            if (appCode.getAppCode().equals(type)) {
                return appCode;
            }
        }
        return isnull;
    }
}
